// pages/classify/index.js
Page({
  data: {
    topBarStatusHeigth: 0,
    activeKey: 0,
    goodsListLeft: [],
    goodsListRight: []
  },

  onLoad() {
    const systemInfo = wx.getSystemInfoSync()
    // console.log(systemInfo)
    this.setData({
      topBarStatusHeigth: systemInfo.statusBarHeight
    })

    this.getGoodsListLeft()
  },

  async getGoodsListLeft() {
    const {data} = await wx.http.get('/category/list')
    // console.log(data)
    if (data.status !== 200) return wx.utils.toast()
    this.setData({
      goodsListLeft: data.data.list,
      goodsListRight: data.data.list[0].children
    })
  },

  async getGoodsListRight(e) {
    // console.log(e.mark.children)
    this.setData({
      goodsListRight: e.mark.children
    })
  }
})